<template>
  <div id="app">
    <!--<h1 v-text="msg" id="DOM"></h1>-->
    <h1 v-text="msg" ref="DOM"></h1>
    <button @click="showDOM">点我输出上方的DOM元素</button>
    <School ref="school"></School>
  </div>
</template>

<script>
import School from "@/components/School.vue";

export default {
  name: 'App',
  components: {
    School,
  },
  data() {
    return {
      msg: '欢迎学习Vue！'
    }
  },
  methods: {
    showDOM() {
      // 原生的DOM操作
      // console.log(document.getElementById('DOM'))
      //   Vue-ref
      // 真实DOM元素
      console.log(this.$refs.DOM)
      // 组件的实例对象
      console.log(this.$refs.school)
    }
  }
}
</script>

<style>
</style>
